//
//  ViewController.m
//  keyBoard
//
//  Created by 王云 on 16/3/26.
//  Copyright © 2016年 com. All rights reserved.
//

#import "ViewController.h"
#import "CoreTFManagerVC.h"
#import "NormalViewVC.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    self.view.backgroundColor = [UIColor redColor];
    
    
    
    
    
    
    
    
    UIView *keyBoardTopView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 44)];
//    keyBoardTopView.backgroundColor = TFColor(237, 240, 241);
    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(keyBoardTopView.bounds.size.width - 60 - 12, 4, 60, 36)];
    [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [btn setTitle:@"完成" forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(onKeyBoardDown:) forControlEvents:UIControlEventTouchUpInside];
    [keyBoardTopView addSubview:btn];
//    stCell.textFiled.inputAccessoryView = keyBoardTopView;

    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
    NormalViewVC *noVC = [[NormalViewVC alloc] init];
    [self.navigationController pushViewController:noVC animated:YES];
}

- (void)viewDidAppear:(BOOL)animated{
    
    [super viewDidAppear:animated];
    [CoreTFManagerVC installManagerForVC:self scrollView:nil tfModels:^NSArray *{
        
        TFModel *tf = [TFModel modelWithTextFiled:_one inputView:nil insetBottom:0];
        TFModel *tff = [TFModel modelWithTextFiled:_two inputView:nil insetBottom:0];
        TFModel *tfff = [TFModel modelWithTextFiled:_three inputView:nil  insetBottom:0];
        return @[tf,tff,tfff];
    }];

    
}

- (void)viewDidDisappear:(BOOL)animated{
    [super viewDidDisappear:animated];
    
    [CoreTFManagerVC uninstallManagerForVC:self];
    
}




@end
